package com.source.quartz;

import com.sun.org.apache.bcel.internal.generic.RETURN;
import org.springframework.aop.scope.ScopedProxyUtils;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * @Author wengqy
 * @Date 2020/12/16
 */
public class Test {
    public static void main(String[] args) {
      /*  String name=("aaa_320826_ddd.txt|bbbb_320825_ddddddddddddddd.txt".split("\\|",-1))[0];
        String substring = name.substring(name.indexOf("_")+1, name.lastIndexOf("_"));
        System.out.println(substring);*/

      /* Stream.of("hello","world").map(s -> s.split("")).forEach(System.out::println);
         System.out.println("--------------");
         Stream.of("hello", "world").flatMap(s -> Stream.of(s.split(""))).forEach(System.out::println);*/

      /*List<Integer> list = Stream.of(1, 4, 78, 33, 66, 44, 2).map(x -> x + 1).collect(Collectors.toList());
        List<Integer> list2 = Stream.of(1, 4, 78, 33, 66, 44, 2).map(x -> x + 1).filter(x->x%79==0).collect(Collectors.toList());
        List<Integer> list3 = Stream.of(1, 4, 78, 33, 66, 44, 2).map(x -> x + 1).sorted().collect(Collectors.toList());
        List<Integer> list4 = Stream.of(1, 4, 78, 33, 66, 44, 2).map(x -> x + 1).filter(x->x%2==0).sorted().collect(Collectors.toList());
        System.out.println(list);
        System.out.println(list2);
        System.out.println(list3);
        System.out.println(list4);*/

/*        List<Integer> collect = IntStream.rangeClosed(0, 6).mapToObj(x -> x * x).collect(Collectors.toList());
        System.out.println(collect);*/
        List<Integer> list = Arrays.asList(1, 3, 55, 3, 4, 5, 77, 99, 99,99);/*
        list.stream().map(x->x+1).sorted().distinct().forEach(System.out::println);
        boolean b = list.stream().map(x -> x + 1).sorted().distinct().anyMatch(x -> x % 2 == 0);
        boolean b2 = list.stream().map(x -> x + 1).sorted().distinct().allMatch(x -> x % 2 == 0);
        boolean b3 = list.stream().map(x -> x + 1).sorted().distinct().noneMatch(x -> x % 155 == 0);*/
        long count = list.stream().map(x -> x + 1).sorted().distinct().count();
        System.out.println(count);
      //  Predicate


    }
}
